<?php
namespace app\common\command;

use app\common\model\RentDetails;
use think\console\Command;
use think\console\Input;
use think\console\Output;

class Test extends Command{

    protected $rentDetails;

     public function __construct(RentDetails $rentDetails)
    {
        $this->rentDetails = $rentDetails;
       
    }
    
    protected function configure()
    {
        $this->setName('rent')->setDescription('rent');
    }
    
    protected function execute(Input $input, Output $output)
    {
        $sTime = microtime(true);
        $this->test();
        $eTime = microtime(true);
        $time = $eTime - $sTime;
        $output->writeln('消耗时间'.$time.'秒');
    }

    public function test(){
        $this->rentDetails->where(['delete_time'=>null,'belongs_month'=>1])->chunk(100, function($data) {
            
        });
            
        
    }
}